<%@ page import="java.util.List" %>
<%@ page import="model.Essay" %><%--
  Created by IntelliJ IDEA.
  User: 12138
  Date: 2020/12/22
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>搜索结果</title>
    <link rel="stylesheet" type="text/css" href="css/common_index.css">
    <link rel="stylesheet" type="text/css" href="css/style_se.css">
    <script type="text/javascript" src="js/jquery-3.5.1.js"></script>
    <script type="text/javascript" src="js/essay.js"></script>
</head>

<body>
<div id="head">
    <form method="post" action="/QM_war_exploded/Select" id="formSelecte">
        <input type="text" name="keyWord" id="se" placeholder="输入关键词">
        <div id="essaySelect"><p  class="icon-sk008"></p> </div>
    </form>
    <a class="btn pill fill " id="btn_back">返回首页 </a>
</div>
<div id="body">

</div>
<div id="bottom">
    <p>Copyright©2020 仓颉博客版权所有</p>
</div>
</body>


<script type="text/javascript" >
    $(function(){
        init()
        function init (){
            <% List<String[]> essayList=(List<String[]>)session.getAttribute("essayList");
            List<String[]> essayLabelList=(List<String[]>)session.getAttribute("essayLabelList");%>
            <%for ( String[] s: essayList) {%>
            var str='  <div class="item' ;
            <%
              switch (s[3]){
                case "技术":%>str+=' ji'<%
        break;
          case "新闻":%>str+=' news'<%
        break;
          case "人物":%>str+=' man'<%
        break;
        default:
       }%>
            str+='   "> <h3><%=s[2]%></h3><br>\n' +
                '    <p></p>\n' +
                '    <div class="div_label">\n' ;
            <%for (String[] x:essayLabelList){
                if(s[0].equals(x[0])){%>
            str+='<div class="lable_item">&nbsp;#<%=x[2]%>#&nbsp;</div>'
            <%}
      }%>
            str+= '<p class="read_sum">阅读量：<%=s[7]%></p><p class="zan_sum">赞：<%=s[8]%></p><p class="auther">作者:<%=s[9]%></p>\n' +
                '    </div>\n' +
                '<form hidden="true" class="show" method="post" action="/QM_war_exploded/ShowEssay" style="z-index: 999">\n' +
                '   <input type=\'hidden\' value=\'<%=s[0]%>\' name=\'fromeid\'>' +
                '    <input type="submit"  value="提交">\n' +
                '   \n' +
                '</form>'+
                '  </div>'
            $("#body").append(str)
            <%} %>
        }
        $("#btn_back").on("click",function(){
            window.location.href = "index.jsp";
        });
        $(".item").on("click",function () {
            $(this).children(".show").submit()
            /*alert($(this).children(".show").attr("method"))*/
        })
    })
</script>
</html>

